<template>
    <div style="background:white;height:100%">
        <v-toolbar dark color="primary" style="box-shadow:none">
            <v-icon>keyboard_arrow_left</v-icon>
            <v-toolbar-title style="margin:0" @click="$router.back(-1)">通知公告</v-toolbar-title>
        </v-toolbar>
        <v-container>
            <v-layout row wrap>
                <v-flex text-xs-center xs12 style="margin-bottom:20px">
                    <h2>{{announcement_title}}</h2>
                </v-flex>
                <v-flex>
                    <p style="font-size:15px;text-indent:2em">{{announcement_content}}</p>
                </v-flex>
                <v-flex>
                    <v-icon>person</v-icon>
                    <span>{{created_by}}</span>
                </v-flex>
                <v-flex>
                    <span style="float:right;line-height:26px">发布于{{created_on}}</span>
                </v-flex>
            </v-layout>
        </v-container>
    </div>
</template>

<script>
export default {
    data(){
        return {
            announcement_title:'停水通知',
            announcement_content:'信息学部各用户：因配合信息学部专用中心配电室一回供电电源（茶绘线）改迁后的接驳工作，定于2018年5月31日（周四）及6月5日（周二）上午6时至7时进行倒闸操作。届时信息学部将短时停电、停水，请各用户做好停电、停水准备，由此带来的不便，敬请谅解。',
            created_on:'2018-1-1',
            created_by:'物业',
        }
    },
    methods:{
        getDetails(){
            this.$axios({
                method:'get',
                url:this.SERVER+'/announcements/'+this.$route.params.announcementID,
                headers:{
                    'Content-Type':'multipart/form-data',
                    'Authorization':'bearer'+localStorage.getItem('Access-Token')
                }
            }).then(
                function(response){
                    var res=response.parseJSON()
                    this.announcement_title=res['announcementTitle']
                    this.announcement_content=res['announcementContent']
                    this.created_on=res['createdOn']
                    this.created_by=res['cratedBy']
                }
            ).catch({
                function(response){
                    console.log(response)
                }
            })
        }
    },
    mounted(){
        // this.getParams()
    }
}
</script>


